<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <title>Title</title>
    <script src="http://www.gbox.tech/lib/jquery-1.10.2.min.js" type="text/javascript"></script>
</head>
<body>
<h1 th:inline="text">Hello</h1>
<p th:text="${hello}"></p>

<p >国际化</p>
<p th:text="#{welcome}"></p>
<form method="POST" enctype="multipart/form-data" action="/spring-boot/upload">
    <p>文件：<input type="file" name="file" /></p>
    <p><input type="submit" value="上传" /></p>
</form>

<h2></h2>
<form method="POST" enctype="multipart/form-data" action="/spring-boot/batchupload">
    <p>文件1：<input type="file" name="file" /></p>
    <p>文件2：<input type="file" name="file" /></p>
    <p>文件3：<input type="file" name="file" /></p>
    <p><input type="submit" value="多文件上传" /></p>
</form>

<form action="/spring-boot/changeSessionLanauage" method="get">
    <input name="lang" type="hidden" value="zh"  />
    <button>切换为中文</button>
</form>

<form action="/spring-boot/changeSessionLanauage" method="get">
    <input name="lang" type="hidden" value="en" />
    <button>切换为英文</button>
</form>


<form action="/spring-boot/loggers/com.xzs" method="POST">
    <input id="configuredLevel" name="configuredLevel" type="text" value="DEBUG" />
    <p><input type="button" value="改变日志级别"  onclick="changeLogLevel()"/></p>
</form>
<script >

    function changeLogLevel(){
        var formdata = {
            "configuredLevel" : $("#configuredLevel").val()
        };
        $.ajax({
            type: "POST",
            url: "/spring-boot/loggers/com.xzs",
            contentType: "application/json; charset=utf-8",
            data: JSON.stringify(formdata),
            dataType: "json",
            success: function (message) {
                //alert("回执信息为：" + message);
                //alert("哈哈：" + message.Success);

                if (true == message.Success) {
                    alert("保存成功");
                } else {
                    alert("保存失败");
                }
            },
            error: function (message) {
                $("#request-process-patent").html("提交数据失败！");
            }
        });
    }

</script>
</body>
</html>